home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD022b.dsk
/
PARA TESTER.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
5KB
|
150 lines
1 REM PARAPSYCHOLOGY TESTER
2 REM BY DAVID DURKEE-SOFTTALK-JUN 83..MODIFIED BY RA BRIGGS LAKE WALES,FL
10 GOSUB 1500
20 GOSUB 1200
30 TEXT : HOME : INVERSE : PRINT SPC( 40): POKE 34,1
40 DEF FN H(X) = 1 +D +4 *(X -1)
50 POKE -16368,0
60 REM SEED RANDOM NUMBER
70 VTAB 15: HTAB 10: INVERSE : PRINT "HIT A KEY TO START"
80 R = RND(1):K = PEEK( -16384): IF K <128 THEN 80
90 POKE -16368,0: HOME
100 NORMAL : PRINT : PRINT
110 VTAB 4: HTAB 1: INPUT "HOW MANY TRIALS (5-33)?";TR
120 IF TR <5 OR TR >33 THEN 110
130 VTAB 5: HTAB 1: INPUT "HOW MANY CHOICES (2-10)?";NC
140 IF NC <2 OR NC >10 THEN 130
150 D = 20 -2 *NC
170 F1 = 1:F2 = 1:F3 = 1
200 VTAB 24: HOME : GOSUB 450
210 RN = INT( RND(6) *NC) +1
220 GOSUB 590
230 IF RN < >N THEN 250
240 NH = NH +1
250 NT = NT +1: GOSUB 670
260 IF NT = TR THEN 870
270 GOTO 200
280 REM PARAMETER INPUT
290 PRINT M$;
300 GET A$: IF A$ < >"Y" AND A$ < >"N" THEN 300
310 PRINT A$: RETURN
320 REM TOPLINE
330 IF NT = 0 THEN PC = 0: GOTO 350
340 PC = INT((NH/NT) *100)
350 INVERSE : VTAB 1
360 HTAB 1: PRINT "TRIALS:";NT;"";
370 HTAB 14: PRINT "HITS:";NH;"";
380 HTAB 24: PRINT "% RIGHT:";PC; SPC( 40 - PEEK(36));
390 NORMAL
400 RETURN
410 REM NOISE FEEDBACK
420 IF RN = N THEN PRINT CHR$(7); CHR$(7);: RETURN
430 FOR X = 1 TO 20:Z = PEEK( -16336): NEXT X
440 RETURN
450 REM PRINT "HAND"
460 INVERSE
470 FOR X = 1 TO NC
480 FOR DL = 1 TO 30 *(11 -NC): NEXT DL
490 FOR Y = 1 TO 3: VTAB 10 +Y
500 HTAB FN H(X)
510 PRINT SPC( 3)
520 NEXT Y
530 VTAB 12: HTAB 1 + FN H(X)
540 IF X = 10 THEN PRINT 0;: GOTO 560
550 PRINT X;
560 NEXT X
570 NORMAL
573 HTAB 1: VTAB 18
575 IF RS$ = "K" GOTO 578
576 PRINT "PADDLE OR JOYSTICK MOVES LEFT & RIGHT": PRINT : PRINT "BUTTON MAKES SELECTION": GOTO 580
578 PRINT "ARROW KEYS MOVE LEFT & RIGHT": PRINT : PRINT "<RETURN> KEY MAKES SELECTION"
580 RETURN
590 IF RS$ = "K" THEN GOSUB 1300: RETURN
600 VTAB 15:N1 = 0
610 N = INT( PDL(0) *NC/256) +1
620 IF PEEK( -16287) >127 AND N1 = N THEN RETURN
630 IF N = N1 THEN 610
640 N1 = N
650 HTAB 1: CALL -868: HTAB 1 + FN H(N): PRINT "^";
660 GOTO 610
670 REM FEEDBACK ROUTINE
680 IF F1 THEN GOSUB 410
690 IF F2 THEN GOSUB 320
700 IF NOT F3 THEN RETURN
710 FOR X = 1 TO 6
720 IF RN = N THEN NORMAL : VTAB 5: HTAB 16: PRINT "RIGHT!!!"
730 FOR DL = 1 TO 75: NEXT DL
740 VTAB 11
750 NORMAL : IF X/2 = INT(X/2) THEN INVERSE
760 FOR Y = 1 TO 3
770 VTAB 10 +Y: HTAB FN H(RN)
780 PRINT SPC( 3);
790 NEXT Y
800 VTAB 12: HTAB 1 + FN H(RN)
810 IF RN = 10 THEN PRINT "0";: GOTO 830
820 PRINT RN;
830 VTAB 5: HTAB 1: CALL -868: FOR DL = 1 TO 75: NEXT DL
840 NEXT X
850 NORMAL
860 RETURN
870 REM DO END OF RUN STATISTICS
880 GOSUB 320
890 PB = 0
895 IF NH = 0 GOTO 940
900 FOR X = 0 TO NH -1
910 GOSUB 1060
920 PB = PB +PR
930 NEXT X
940 PB = 1 -PB
950 HOME
960 VTAB 5: HTAB 8: PRINT "TRIALS:";NT
970 VTAB 7: HTAB 7: PRINT "CHOICES:";NC
980 VTAB 9: HTAB 10: PRINT "HITS:";NH
990 PRINT "....................."
1000 PRINT "PROBABALITY=";PB
1010 PRINT
1020 IF PB >.05 GOTO 1030
1022 PRINT "THIS IS STATISTICALLY SIGNIFICANT."
1025 PRINT : PRINT "YOU WOULD DO THAT WELL OR BETTER BY": PRINT : PRINT "CHANCE ALONE ONLY "; INT(PB *100);" PERCENT OF THE TIME."
1027 GOTO 1050
1030 PRINT "THIS IS NOT STATISTICALLY SIGNIFICANT."
1035 PRINT : PRINT "YOU WOULD DO AT LEAST THAT WELL BY": PRINT : PRINT "CHANCE ALONE "; INT(PB *100);" PERCENT OF THE TIME."
1050 VTAB 23: HTAB 12: PRINT "AGAIN? (Y OR N)";: GET AG$: PRINT AG$: HOME : IF AG$ = "Y" THEN CLEAR : GOTO 20
1051 PRINT : PRINT CHR$(4)"RUNMENU"
1060 REM CALCULATE PROBABILITY
1070 P = 1/NC:Q = 1 -P
1080 N = NT: GOSUB 1130:N1 = NF
1090 N = X: GOSUB 1130:N2 = NF
1100 N = NT -X: GOSUB 1130:N3 = NF
1110 PR = (N1 *P ^X *Q ^(NT -X))/(N2 *N3)
1120 RETURN
1130 REM FACTORIAL
1140 NF = 1
1150 FOR CT = 1 TO N
1160 NF = NF *CT
1170 NEXT
1180 RETURN
1200 HOME : VTAB 4
1212 PRINT : HTAB 10: PRINT "K = KEYBOARD": PRINT : HTAB 10: PRINT "P = PADDLES": PRINT : HTAB 10: PRINT "J = JOYSTICK": PRINT : PRINT "WHICH ";: GET RS$: PRINT RS$
1280 HOME : NORMAL : RETURN
1300 REM KEYBOARD INPUT ROUTINE
1310 VTAB 15:N = INT(NC/2)
1320 HTAB 1: CALL -868: HTAB 1 + FN H(N): PRINT "^";
1330 HTAB 1 + FN H(N): GET A$
1340 IF A$ = CHR$(13) THEN RETURN
1350 IF A$ = CHR$(8) THEN N = N -1: GOTO 1380
1360 IF A$ = CHR$(21) THEN N = N +1: GOTO 1380
1370 GOTO 1330
1380 IF N <1 THEN N = NC
1390 IF N >NC THEN N = 1
1395 GOTO 1320
1500 TEXT : HOME : HTAB 08: PRINT "PARAPSYCHOLOGY TESTER"
1510 PRINT : PRINT " THIS PROGRAM WAS WRITTEN BY DAVID"
1520 PRINT : PRINT "DURKEE AND WAS SENT TO SOFTDISK BY"
1530 PRINT : PRINT "R.A. BRIGGS. IT FIRST APPEARED"
1540 PRINT : PRINT "ON PAGE 223 OF JUNE 83 SOFTALK."
1550 PRINT : PRINT " THE OBJECT OF THE PROGRAM IS TO TRY"
1560 PRINT : PRINT "TO OUTGUESS THE APPLE RANDOM NUMBER"
1570 PRINT : PRINT "GENERATOR. IF YOU GUESS RIGHT OFTEN"
1580 PRINT : PRINT "ENOUGH THEN MAYBE YOU HAVE ESP."
1599 VTAB 24: HTAB 10: INVERSE : PRINT "HIT SPACE BAR";: NORMAL : GET R$: PRINT R$: RETURN